package org.six11.olive3;

import java.net.MalformedURLException;
import java.net.URL;

import org.six11.olive3.client.OliveDrawingSurface;
import org.six11.olive3.client.OliveState;
import org.six11.olive3.net.OliveNetworkTransmitter;
import org.six11.olive3.util.MultiState;
import org.six11.util2.Debug;
import org.six11.util2.gui.ApplicationFrame;

/**
 * Used to run a simple application based on Olive3.
 **/
public abstract class Main {
  
  /**
   * @param args optional arguments.
   */
  public static void main(final String[] args) {
    System.out.println("\n\n\t N O T E:    I am likely to be broken. See the source.\n\n\n");
    Debug.useColor = false;
    //OliveState state;
    MultiState state;
    OliveNetworkTransmitter xmit;
    ApplicationFrame frame;
    try {
      // state = new OliveState();
      state = new MultiState();
      xmit = new OliveNetworkTransmitter(state, new URL("http://localhost:8080/picturephone/ink"));
      xmit.addToMessage("login ()", "");
      OliveDrawingSurface olive = new OliveDrawingSurface(xmit, new OliveState(state));
      frame = new ApplicationFrame("Olive3");
      frame.add(olive);
      frame.setSize(600, 500);
      frame.center();
      frame.setVisible(true);
    } catch (MalformedURLException ex) {
      ex.printStackTrace();
    }
  }

} 
